// components/activity/activity-timeline-item/index.js
import componentBehavior from '../../../behaviors/component';
import { COMPONENT_OPTIONS, ACTIVITY_TYPE_MAP } from'../../../constants/common';
import { ACTIVITY_STATUS_VALUE, ACTIVITY_STATUS } from '../../../constants/activity';

Component({
    behaviors: [componentBehavior],
    options: {
        ...COMPONENT_OPTIONS,
    },
    properties: {
        activityInfo: {
            type: Object,
            value: {},
        },
    },
    observers: {
        'activityInfo': function (val) {
            if (val) {
                this.setData({
                    statusStr: ACTIVITY_STATUS[val.processStatus],
                });
            }
        },
    },
    data: {
        ACTIVITY_TYPE_MAP,
        ACTIVITY_STATUS_VALUE,
        statusStr: '',
    },
    methods: {
        handleClick() {
            this.triggerEvent('click', this.data.activityInfo);
        },
    }
})

